home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / PROGMISC / FPCHELP.LZH / KERNEL4.HLP < prev    next >
Text File  |  1988-02-24  |  6KB  |  172 lines

  1. KERNEL4.HLP         Edited by J. McKnight  H 408-252-7396  1988-01-30
  2.  
  3.        Extensible Layer: Defining Words        
  4.  
  5. #USER  Count of how many user variables are allocated.
  6. USER   Vocabulary that holds task versions of defining words.
  7.  
  8. ALLOT          ( n )
  9.        Allocate some space in the user area for a task. When used with CREATE,
  10.        you can define arrays this way.
  11.  
  12. CREATE         <name> ( -- )
  13.        Define a word that returns the address of the next available user
  14.        memory location.
  15.  
  16. VARIABLE       <name> ( -- )
  17.        Define a task type variable. This is similar to the old FIG version of
  18.        USER.
  19.  
  20. DEFER          <name> ( -- )
  21.        Defines an execution vector that is task local.
  22.  
  23.  
  24.        Extensible Layer: ReDefining Words
  25.  
  26. >IS            ( cfa -- data-address )
  27.        Maps a code field into a data field. If the word is in the USER class
  28.        of words, then the data address must be calculated relative to the
  29.        current user pointer. Otherwise it is just the parameter field.
  30.  
  31. (IS)           ( cfa -- )
  32.        The code compiled by IS. Sets the following DEFERred word to the
  33.        address on the parameter stack.
  34.  
  35. IS             ( cfa -- )
  36.        Depending on STATE, either sets the following DEFERred word immediatly
  37.        or compiles the setting for later.
  38.  
  39. SELECT          ( n1 --- )
  40.         Select drive n1 as the current disk drive to use as the DEFAULT
  41.         drive when no drive is specified. N1 ranges from 0 which is drive
  42.         A:, to a legal value up to 255 in DOS.
  43.  
  44. A:
  45. B:
  46. C:
  47. D:              ( --- )
  48.         Select drive A:, B:, C:, or D: as the default drive.
  49.  
  50. QUIT           ( -- )
  51.        The main loop in Forth. Gets more input from the terminal and
  52.        Interprets it. Responds with OK if healthy.
  53.  
  54. BOOT   The very first high level word executed during cold start. 
  55.  
  56. INITSTUFF       ( --- )
  57.         A DEFERed word chain, used by many system utilities that need to
  58.         specify a function to be performed at cold start time.  See also
  59.         DEFERS for more information on how defered word chains work.
  60.  
  61. SEGSET          ( --- )
  62.         A DEFERed word that contain the current function used to set up
  63.         the segment registers at cold start time. Typically contains
  64.         SETYSEG.
  65.  
  66. WARMSTRT       ( -- )
  67.         The default function to be performed on a WARM start.  This word
  68.         is plugged into the DEFERed word WARMFUNC, to specify what is
  69.         done when the CONTROL BREAK key is pressed.  See also WARMFUNC and
  70.         WARM.
  71.  
  72. WARMFUNC        ( --- )
  73.         A DEFERed word that is invoked when a warm start occurs. This
  74.         function is called whenever the CONTROL BREAK key is pressed.
  75.  
  76. WARM           ( -- )
  77.         The WARM entry point for Forth, just calles the DEFERed word
  78.         WARMFUNC, then calls BYE is WARMFUNC returns. A WARM start is
  79.         invoked whenever the CONTROL BREAK key is pressed.
  80.  
  81. COLD           ( -- )
  82.        The high level cold start code. For ordinary forth, BOOT should
  83.        initialize and pass control to QUIT.
  84.  
  85. RESTORE_VECTORS ( -- )
  86.         Restores the CONTROL BREAK DOS vectors to their original value
  87.         as when Forth was entered.  The CONTROL BREAK and DIVIDE by 0
  88.         vectors are saved by the assembly language cold start routines
  89.         before Forth is entered.
  90.  
  91. DIV0STRT        ( -- )
  92.         The default function to perform when a DIVIDE by 0 trap occurs.
  93.         This routine aborts. A divide by 0 trap calls DIV0FUNC, which
  94.         defers to this routine.
  95.  
  96. DIV0FUNC        ( -- )
  97.         FF traps divide by 0 errors, and calls this defered word when
  98.         such an error is detected.  You can change the contents of this
  99.         defered words to handle divide by 0 errors in your own program.
  100.  
  101. BYEFUNC         ( --- )
  102.         A defered word which normally contains NOOP, provided wo you
  103.         can specify a function to be performed before leaving back to
  104.         DOS.
  105.  
  106. BYE            ( -- )
  107.         Returns control to DOS. Performs the defered word BYEFUNC before
  108.         actually leaving.
  109.  
  110. DIVIDE0        ( status_reg CS IP AX BX CX DX SI BP -- )
  111.         The actual entry point from the divide by 0 trap, this word just
  112.         calls the deferd word DIV0FUNC.  Normally the registers on the
  113.         stack are just discarded, but you can install your own routine
  114.         into DIV0FUNC to handle the divide by 0 error.
  115.  
  116. SET_VECTORS    ( -- )
  117.         Set the CONTROL BREAK and DIVIDE by 0 traps to point to the
  118.         Forth provided functions, so we can handle them smoothly.
  119.  
  120. DEPTH          ( -- n )
  121.        Returns the number of items on the parameter stack.
  122.  
  123. .S             ( -- )
  124.        Displays the contents of the parameter stack non destructively. Very
  125.        useful when debugging.
  126.  
  127. .ID            ( nfa -- )
  128.        Display the variable length name whose name field address is on the
  129.        stack. If it is shorter than its count, it is padded with underscores.
  130.        Only valid Ascii is typed.
  131.  
  132. DUMP           ( addr len -- )
  133.        A primitive little dump routine to help you debug after you have
  134.        changed the system source and nothing works any more.
  135.  
  136. RECURSE        ( -- )
  137.        ????? We prefer to use RECURSIVE rather than RECURSE. ( See RECURSIVE )
  138.  
  139. H.             ( u -- )
  140.        Display the unsigned number in hex, with trailing blank. Does not
  141.        change the number base.
  142.  
  143. LMARGIN         ( -- a1 )
  144.         The left margin setting used by ?LINE, ?CR. When a line
  145.         wrap occurs, then LMARGIN specifies how many spaces are printed
  146.         on the following line. Default value is 0.
  147.  
  148. RMARGIN         ( -- a1 )
  149.         Controls the right margin, used by ?LINE, ?CR. Specifys
  150.         where to wrap the line.  Default value is 70.
  151.  
  152. TABSIZE         ( --- a1 )
  153.         Controls the TAB increment for TAB. Default is 8.
  154.  
  155. ?LINE          ( n -- )
  156.         Break the line at the cursor if there are less than n1 characters
  157.         till RMARGIN is encountered.
  158.  
  159. ?CR            ( -- )
  160.         Break the line at the cursor, if we have reached the right margin
  161.         as specified by RMARGIN.
  162.  
  163. TAB            ( -- )
  164.         Print spaces to get to the next TAB increment as specified by
  165.         TABSIZE.
  166.  
  167. \              ( -- )
  168.        Comment till the end of this line
  169.        
  170.  
  171.  
  172.